<?php
# 引入SDK模块
require_once './sdk/opanapi.php';
require_once './sdk/webhook.php';
require_once './sdk/logger.php';

# 设置Token并开启实例
sdk::init("your_token_here");
data::init();

if (data::$event_type == "message.receive.normal") {
    $button = [
        [
            {
                "text" => "复制",
                "actionType" => 2,
                "value" => "这是你想要复制的内容"
            },
            {
                "text" => "跳转百度",
                "actionType" => 1,
                "url" => "http://www.baidu.com"
            },
            {
                "text" => "汇报",
                "actionType" => 3,
                "value" => "xxxx"
                // 汇报后逻辑请看elseif部分
            },
        ]
    ]
    if (data::$content == "ping") {
        send.text(data::$chat_id, data::$chat_type, "pong", $button);
        send.md(data::$chat_id, data::$chat_type, "# pong", $button);
        send.html(data::$chat_id, data::$chat_type, "<h1>你好</h1>", $button);
    }
} elseif (data::$event_type == "button.report.inline") {
        send.text(data::$chat_id, data::$chat_type, "成功");
        send.md(data::$chat_id, data::$chat_type, "# 收到");
        send.html(data::$chat_id, data::$chat_type, "<h1>汇报消息</h1>");
}
